<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="css/pintuer.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jquery.js"></script>
<script src="js/pintuer.js"></script>
</head>
<body>
	<div class="panel admin-panel">
		<div class="panel-head">
			<strong><span class="icon-key"></span> 修改会员密码</strong>
		</div>
		<div class="body-content">
			<form method="post" class="form-x" action="">
				<div class="form-group">
					<div class="label">
						<label style="margin-left: 10px;"
							for="sitename">管理员：<span id="user">${user}</span></label>
					</div>
					<div class="field">
						<label style="line-height: 33px;"> </label>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label for="sitename">原始密码：</label>
					</div>
					<div class="field">
						<input type="password" class="input w50" id="mpass" name="mpwd"
							size="50" placeholder="请输入原始密码" data-validate="required:请输入原始密码" />
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label for="sitename">新密码：</label>
					</div>
					<div class="field">
						<input type="password" class="input w50" name="newpwd" size="50"
							placeholder="请输入新密码"
							data-validate="required:请输入新密码,length#>=5:新密码不能小于5位" />
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label for="sitename">确认新密码：</label>
					</div>
					<div class="field">
						<input id="renewpwd" type="password" class="input w50"
							name="renewpwd" size="50" placeholder="请再次输入新密码"
							data-validate="required:请再次输入新密码,repeat#newpwd:两次输入的密码不一致" />
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button id="tijiao" class="button bg-main icon-check-square-o"
							type="button">提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</body>
<script src="${pageContext.request.contextPath}/layui/layui.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(function(){
	$("#tijiao").click(function(){		
		var user=$("#user").text();
		var renewpwd=$("#renewpwd").val();
		var mpwd=$("#mpass").val();
			$.ajax({
				url:'${pageContext.request.contextPath}/UpdateServelt',
				data:{
					'action':'update',
					'user':user,
					'mpwd':mpwd,
					'renewpwd':renewpwd	
				},
				type:'post',
				dataType:'json',
				success:function(data){
					if(data.count == 1){					
						layer.msg(data.msg);
						parent.window.location='${pageContext.request.contextPath}/login.jsp'
					}else{
						layer.msg(data.msg);
					}
					
				}	
					
			})
			return false;
	    })
	})


</script>

</html>